<extend name="Public:base" />
<block name="left">
    <ul class=" ">
        <li><a href="{:U('Person/auth')}">           实名认证</a></li>
        <li><a href="{:U('Person/set_pwdtrade')}">   交易密码设置</a></li>
        <li><a href="{:U('Person/updatepwd')}">      修改登录密码</a></li>
        <li><a href="{:U('Person/change_pwdtrade')}">修改交易密码</a></li>
        <li><a href="{:U('Person/forgot_pwdtrade')}">找回交易密码</a></li>
     
        <li><a href="{:U('Person/mail_check')}">邮箱验证</a></li>
      <!--   <li><a href="">邮件通知</a></li>
         <li><a href="">设置双重验证</a></li>
        <li><a href="">手机绑定</a></li>
      -->
    </ul>
</block>
<block name="right">
    <br>
    <br>
    <div class="ziliao">

           <div class="top-tip margin-top-20 clearfloat">
                温馨提示：你好，交易密码设置 ！
        </div>
         <br>

    <if condition="$userinfos['pwdtrade'] eq ''">
    <form action="{:U('Person/set_pwdtrade_act')}" method="POST" onsubmit="return check_form()">
        <div class="col-xs-10">
            <label class="label-name" for="nick">交易密码</label>
            <input type="password" name="pwdtrade" id="pwd" class="ziliaobucz" >
        </div>
        <br>
        <br>
        <div class="col-xs-10">
            <label class="label-name" for="nick">确认密码</label>
            <input type="password" name="pwdtrade_cfm" id="pwd_cfm" class="ziliaobucz" >
        </div>
        <br>
        <br>
        <div>
            <input class="ziliaobu" type="submit" name="submit" value="保存">
        </div>
        <script type="text/javascript">
            function check_form() {
                var pwd = document.getElementById('pwd');
                var pwd_cfm = document.getElementById('pwd_cfm');
                var reg =/^\d{6}$/;
                var err_msg = '';
                if (!reg.test(pwd.value)) {
                    err_msg += '交易密码格式为6位数字\n';
                }
                if (pwd.value != pwd_cfm.value) {
                    err_msg += '两次密码输入不一致\n';
                }
                if (err_msg != '') {
                    alert(err_msg);
                    pwd.value = '';
                    pwd_cfm.value = '';
                    return false;
                }
                return true;
            }
        </script>
    </form>
    <else/>
    <h1>您已经设置过交易密码了</h1>
    </if>
    </div>
    <div></div>
</block>
